/*!
* @file Axis.h
* @brief 三维轴
* @date 2024/9/12
*/
#pragma once

#include "Vector3D.h"

namespace data
{
class Placement;

/*!
* @brief 三维轴
*/
class DATA_API Axis
{
public:
    Vector3d base;
    Vector3d dir;

    /*!
    * @brief 轴构造
    */
    Axis() = default;
    Axis(const Axis&) = default;
    Axis(Axis&&) = default;
    Axis(const Vector3d& b, const Vector3d& d) : base(b), dir(d) {}
    ~Axis() = default;

    /*!
    * @brief 轴运算
    */
    Axis& operator=(const Axis&) = default;
    Axis& operator=(Axis&&) = default;
    bool operator==(const Axis&) const;
    bool operator!=(const Axis&) const;
    Axis operator*(const Placement& plm) const;
    Axis& operator*=(const Placement& plm);

    void Reverse();
    Axis Reversed() const;
    void Move(const Vector3d& vec);
    Axis& Set(const Vector3d& base, const Vector3d& dir);

};

/*!
* @brief 文本信息输出
*/
inline std::ostream& operator<< (std::ostream& stream, const Axis& a)
{
    return stream << "{ base: " << a.base << ", dir: " << a.dir << " }";
}

}  // namespace data
